﻿@page
@model Volo.Abp.Account.Web.Pages.Account.ManageModel
@using Volo.Abp.Identity.Settings
@using Volo.Abp.Settings
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
@inject ISettingProvider SettingManager
@inject IThemeManager ThemeManager
@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage
@{
    Layout = ThemeManager.CurrentTheme.GetApplicationLayout();
    var isUserNameUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled), "true",
        StringComparison.OrdinalIgnoreCase);

    var isEmailUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsEmailUpdateEnabled), "true",
        StringComparison.OrdinalIgnoreCase);
}
@section scripts {
    <abp-script src="/Pages/Account/Manage.js" />
}

<abp-tabs tab-style="PillVertical">
    <abp-tab title="@L["ChangePassword"].Value">
        <abp-dynamic-form abp-model="@Model.ChangePasswordInfoModel" id="ChangePasswordForm">
            <abp-form-content />
            <abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
        </abp-dynamic-form>
    </abp-tab>
    <abp-tab title="@L["PersonalSettings"].Value">
        <form method="post" id="PersonalSettingsForm">

            <abp-input asp-for="PersonalSettingsInfoModel.UserName" readonly="!isUserNameUpdateEnabled" />

            <abp-row>
                <abp-column size-md="_6">
                    <abp-input asp-for="PersonalSettingsInfoModel.Name" />
                </abp-column>
                <abp-column size-md="_6">
                    <abp-input asp-for="PersonalSettingsInfoModel.Surname" />
                </abp-column>
            </abp-row>

            <abp-input asp-for="PersonalSettingsInfoModel.Email" readonly="!isEmailUpdateEnabled" />

            <abp-input asp-for="PersonalSettingsInfoModel.PhoneNumber" />

            <abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
        </form>
    </abp-tab>

</abp-tabs>